package com.nulstudio.sppm.Service;

import com.nulstudio.sppm.Dao.CustomerMapper;
import com.nulstudio.sppm.Dao.SupplierMapper;
import com.nulstudio.sppm.Entities.Customer;
import com.nulstudio.sppm.Entities.SupplierInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerService {
    @Autowired
    private com.nulstudio.sppm.Dao.CustomerMapper CustomerMapper;

    public List<Customer> getAllCustomers() {
        return CustomerMapper.getAllCustomers();
    }

    public int addCustomer(Customer Customer) {
        return CustomerMapper.addCustomer(Customer);
    }

    public int modifyCustomer(Customer request) {
        return CustomerMapper.modifyCustomer(request);
    }

    public int getIdByInfo(Customer request) {
        return CustomerMapper.getIdByInfo(request);
    }

    public int getLastId() {
        return CustomerMapper.getLastId();
    }
    public int deleteCustomer(String id){return CustomerMapper.deleteCustomer(Integer.parseInt(id));}

}
